import request from "@/api/request.js";

export function pagePostsByFilters({
                                       pageNum,
                                       pageSize,
                                       topicId,
                                       startTime,
                                       endTime,
                                       startLikeNum,
                                       endLikeNum,
                                       startCollectNum,
                                       endCollectNum,
                                       startViewNum,
                                       endViewNum,
                                       startWordNum,
                                       endWordNum,
                                       contentKey,
                                       isNameless,
                                       timeRange,
                                       isDie }) {
    if (timeRange != null && timeRange.startTime != null) {
        startTime = timeRange.startTime
    }
    if (timeRange != null && timeRange.endTime != null) {
        endTime = timeRange.endTime
    }
    const params = {
        pageNum,
        pageSize,
        topicId,
        startTime,
        endTime,
        startLikeNum,
        endLikeNum,
        startCollectNum,
        endCollectNum,
        startViewNum,
        endViewNum,
        startWordNum,
        endWordNum,
        contentKey,
        isNameless,
        isDie
    }
    return request({
        url: '/admin/management/post/page',
        method: 'get',
        params: params
    })
}
export function getPostTopics() {
    return request({
        url: '/user/post/topics',
        method: 'get',
    })
}
